package com.fengfeng.view.dialog;


import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.fengfeng.sdk.R;

public class UserDialog extends Dialog {
    private ImageView game1, game2;

    public UserDialog(@NonNull Context context) {
        super(context, R.style.CustomDialog);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.user_dialog_layout);
        //按空白处不能取消动画
        setCanceledOnTouchOutside(false);
        //初始化界面控件
        initView();
        //初始化界面控件的事件
        initEvent();

        /**
         * 使用 glide给游戏长图片设置圆角
         */

        RequestOptions options = new RequestOptions()
         .placeholder(R.drawable.download)
         .bitmapTransform(new RoundedCorners(15));

         Glide.with(getContext()).asBitmap()
         .load(R.drawable.download)
         .apply(options)
         .into(game1);


         Glide.with(getContext()).asBitmap()
         .load(R.drawable.game2)
         .apply(options)
         .into(game2);





    }


    private void initView() {
        game1 = findViewById(R.id.imageView14);
        game2 = findViewById(R.id.imageView15);
    }

    private void initEvent() {
    }

    @Override
    public void show() {
        super.show();
    }
}
